#include <bits/stdc++.h>
// 2025/01/28
// tag: 
// Author: Zhang Muen
using namespace std;

unordered_map<int, int> mp;
int ans[10001];

void factor(int x){
    for (int i = 1; i * i <= x; i++)
        if (x % i == 0){
            mp[i]++;
            if (i != x / i)
                mp[x / i]++;
        }
}

signed main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        int x;
        cin >> x;
        factor(x);
    }
    for (auto x: mp){
        for (int i = x.second; i >= 1; i--)
            if (ans[i] < x.first)
                ans[i] = x.first;
            else
                break;
    }
    for (int i = 1; i <= n; i++)
        cout << ans[i] << endl;
    return 0;
}